﻿void UnpackNormalBG_float(float4 packedNormal, float scale, out float3 normal)
{
    normal.xy = packedNormal.gb * 2.0 - 1.0;
    normal.z = max(0.01, sqrt(1.0 - saturate(dot(normal.xy, normal.xy))));
    normal.xy *= scale;
    normal = normalize(normal);
}